//
//  ShopsDetailImageTitleCell.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/8/8.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class ShopsDetailImageTitleCell: BaseTableViewCell {
    
    @IBOutlet weak var leftImageView: UIImageView!
    
    @IBOutlet weak var leftLabel: UILabel!
    @IBOutlet weak var rightLabel: UILabel!
    
    var index : IndexPath?{
        
        didSet{
            if index == nil {
                return
            }
        
            
            switch index!.row {
            case 1:
                leftImageView.image = UIImage(named: "shopDetail03")
                accessoryType = .disclosureIndicator
                
                rightLabel.isHidden = true
                
                if model != nil {
                    leftLabel.text = model?.merchant_address
                }
             case 2:
                accessoryType = .none
                leftImageView.image = UIImage(named: "shopDetail02")
                leftLabel.text = "营业时间:"
                rightLabel.textColor = UIColor.dakGray()
                rightLabel.isHidden = false

                if model != nil {
                    rightLabel.text = model?.merchant_worktime
                }

            default:
                accessoryType = .none
                leftImageView.image = UIImage(named: "shopDetail01")
                leftLabel.text = "联系电话:"
                rightLabel.textColor = UIColor.blue
                rightLabel.isHidden = false

                if model != nil {
                    rightLabel.text = model?.merchant_mobile
                }

            }
        
        
        }
    
    
    }
    
    
    var model : ShopsDetailModel?
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        contentView.backgroundColor = UIColor.white

        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
